mfn_valid should use machine physical pfn, not guest physical pfn.
This patch fixes the regression introduced by 18761:
f6795589ef82.
Sign-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
* which is required by vga acceleration since qemu maps shared
* vram buffer with WB.
*/
- if (mfn_valid(pte_pfn(__pte(pte))) && phy_pte.ma != VA_MATTR_NATPAGE)
+ if (mfn_valid(pte_pfn(__pte(maddr))) && phy_pte.ma != VA_MATTR_NATPAGE)
phy_pte.ma = VA_MATTR_WB;
maddr = ((maddr & _PAGE_PPN_MASK) & PAGE_MASK) | (paddr & ~PAGE_MASK);